import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const state = {
  username: '',
  usermenu: []
}
const mutations = {
  setUsername: (state: any, username: any) => {
    state.username = username
    localStorage.setItem('username', username)
  },
  setUsermenu: (state: any, usermenu: any) => {
    state.usermenu = usermenu
  }
}
const actions = {}
const getters = {
  username: (state: any) => localStorage.getItem('username'),
  usermenu: (state: any) => state.usermenu
}
export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations
})
